[#import "/framework/JGP.htm"  as JGP]
<!--
项目   jgp-cloud-parent
作者   LOUFEI [Gavin]
时间   2019-09-02
-->
[@JGP.head "表单编辑"/]
[@JGP.body]
    <jgp-div _row="['30','*']">
        <div slot="1-1">
            <jgp-btn _fn="saveCallback"  _form="form">保存</jgp-btn>
        </div>
        <jgp-form slot="1-1" _id="form" _action="/form/formApiController/saveForm">
            <jgp-text _label="编码" _name="code" _col="12" _placeholder="唯一" _required="true"></jgp-text>
            <jgp-text _label="表单名" _name="name" _col="12" _required="true"></jgp-text>
            <jgp-radio _label="总列宽" _name="col" _col="12" _required="true" _value="12" _list="[{'label':'12列','value':12},{'label':'24列','value':24}]"></jgp-radio>
            <jgp-text _label="业务关联" _name="relation" _col="12"></jgp-text>
            <jgp-area _label="备注" _name="remark" _col="12" _row="6"></jgp-area>
        </jgp-form>
    </jgp-div>
[/@JGP.body]

[@JGP.foot]
    <script>

        JGP.$onload(function () {
            var formId = '${formId!''}';
            if(formId){
                JGP.$post('/form/formApiController/queryFormById/'+formId,{},function (result) {
                    var fdata = result.data.fdata;
                    JGP.form('form').setFdata(fdata);
                })
            }
        })

        function saveCallback(result) {
            if(result.back.flag){
                JGP.$close(true);
            }
        }
    </script>
[/@JGP.foot]